// 复合分组加密(Composite Block Cipher)，由内层的加密核心和外层的加密模式组成。
// 例如AES128-CBC中，AES128是加密核心，CBC是加密模式。
#pragma once
#include "bc_kernel_i.h"
#include "cbc_mode.h"

class CCompositeBlockCipher : public CVirtualDestruct
{
public:
    IBlockCipherKernel *m_pobjKernel = nullptr;
    C_ECB_MODE *m_pobjMode           = nullptr;

    virtual int Encrypt(BYTE *pKey, int iKeyLen, BYTE *pIV, int iIVLen, BYTE *pIn, int iLenIn, BYTE *pOut, int *piLenOut);
    virtual int Decrypt(BYTE *pKey, int iKeyLen, BYTE *pIV, int iIVLen, BYTE *pIn, int iLenIn, BYTE *pOut, int *piLenOut);
};
